package kz.pompei.var.instruction;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class LineInstruction implements InstructionList {
  private BlockInstruction owner;
  
  private final List<Instruction> list = new ArrayList<Instruction>();
  
  @Override
  public Iterator<Instruction> iterator() {
    return list.iterator();
  }
  
  @Override
  public void addChild(Instruction instruction) {
    list.add(instruction);
    instruction.setParent(this);
  }
  
  public List<Instruction> getList() {
    return list;
  }

  public BlockInstruction getOwner() {
    return owner;
  }

  public void setOwner(BlockInstruction owner) {
    this.owner = owner;
  }
}
